cmake_minimum_required(VERSION 3.25)
project(opengl)
#set(CMAKE_EXE_LINKER_FLAGS "-static")
#set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(THREADS_PREFER_PTHREAD_FLAG ON)
set(CMAKE_CXX_STANDARD 17)

find_package(glad REQUIRED)
find_package(glfw3 REQUIRED)
find_package(glm REQUIRED)
find_package(Libevent CONFIG REQUIRED)
find_package(Threads REQUIRED)

include_directories(opengl ${LIBEVENT_INCLUDE_DIRS})
include_directories(./include
        ./include/imgui
        ./src/tests
        ./src/Game
        ./include/Events
        ./include/utils
        )

file(GLOB_RECURSE SRC_DER_LIST
        include/Render/*.cpp
        include/utils/*.cpp
        include/imgui/*.cpp
        include/Events/*.cpp
        src/tests/*
        src/Game/*
        )
file(GLOB_RECURSE NODE_SRCS include/imgui/main.cpp)
list(REMOVE_ITEM SRC_DER_LIST ${NODE_SRCS})
message(STATUS ${SRC_DER_LIST})
add_executable(opengl main.cpp ${SRC_DER_LIST})
target_link_libraries(opengl PRIVATE glad::glad)
target_link_libraries(opengl PRIVATE glfw)
target_link_libraries(opengl PRIVATE libevent::core libevent::extra Threads::Threads)

